<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<html>
<head>
<title>已发信息列表</title>
<%@include file="/common/ec.jsp"%>
<%@include file="/common/meta.jsp"%>
</head>
<body>
<br>
<table align="center" width="780" style="border-bottom: 2px solid #99BBE8;">
  <tr>
    <td align="left" style="padding-left: 20px;">
	  	<a href="newMsg.do">
	  	  <img src="${ctx}/images/icons/send.png">&nbsp;新建信息</a>
	  	&nbsp;&nbsp;&nbsp;&nbsp;
	  	<a href="receiveIndex.do" style="color: red; font-weight: bold;">
	  		<img src="${ctx}/images/exticons/arrow-down.gif">&nbsp;收信箱</a>
	  	&nbsp;&nbsp;&nbsp;&nbsp;
	  	<a href="sendIndex.do">
	  	  <img src="${ctx}/images/exticons/arrow-up.gif">&nbsp;发信箱</a>
    </td>
  </tr>
</table>
<form action="receiveIndex.do" method="post">
<table width="780" align="center">
  <tr>
    <td> 
		&nbsp;&nbsp;
		发送人：<s:textfield name="model.sender.name" size="8"/>
		&nbsp;&nbsp;
		标题：<s:textfield name="model.title" size="20"/>
		&nbsp;&nbsp;
		从：<input type="text" name="startDate" style="width: 100px" value='<s:date name="startDate" format="yyyy-MM-dd"/>' onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" class="Wdate"/>&nbsp;
		至：<input type="text" name="endDate" style="width: 100px" value='<s:date name="endDate" format="yyyy-MM-dd"/>' onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" class="Wdate"/>
		&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="submit" value="查询" class="button">
	</td>
  </tr>
</table>
</form>
<ec:table items="items" var="item" retrieveRowsCallback="limit" sortRowsCallback="limit" 
	action="receiveIndex.do" 
	useAjax="false"
	doPreload="false" 
	pageSizeList="10,20,50" 
	editable="false"
	sortable="false" 
	rowsDisplayed="10" 
	generateScript="true"
	resizeColWidth="false" 
	classic="false" 
	width="780" 
	height="280px"
	minHeight="280"
	toolbarContent="navigation|pagejump|pagesize|refresh|extend|status">
	<ec:row>
		<ec:column width="38" property="_s" title="No." value="${GLOBALROWCOUNT}" style="text-align:center"/>
		<ec:column width="120" property="sender.name" title="发送人"/>
		<ec:column width="350" property="_title" title="标题" ellipsis="true">
			<s:if test="#attr.item.fileIds != null">
				<img src="${ctx}/images/icons/attachment.gif" title="有附件信息">
			</s:if>
			<s:else>
				<img src="${ctx}/images/icons/timeicon.gif" title="无附件信息">
			</s:else>
			${item.title}
		</ec:column>
		<ec:column width="120" property="createTime" title="发送时间" cell="date" format="yyyy-MM-dd HH:mm"/>
		<ec:column width="60" property="_isRead" title="状态" style="text-align:center">
			<s:if test="#attr.item.isRead == 1"><div style="color:#339933;font-weight:bold;">已读</div></s:if>
			<s:else><div style="color:red;font-weight:bold;">未读</div></s:else>
		</ec:column>
		<ec:column width="90" property="_option" title="操作" style="text-align:center">
			<a href="view.do?model.id=${item.id}&updateState=Y" target="_blank">查看</a>
		</ec:column>
	</ec:row>
</ec:table>
<script type="text/javascript">
/**
 * 删除提交
 */
function remove(){
	 var sels = document.getElementsByName("selectedItems");
	    var checked = false;;
	    for(i = 0; i < sels.length; i++) {
	        if(sels[i].checked) {
	           checked = true;
	           break;
	        }
	    } 
	    if(!checked) {
	    	alert("请选择要删除的内容!");
	    	return;
	    }
	    if (confirm("确定要删除所选择的内容吗？删除后不能恢复!")){
	        	var from = document.getElementById("ec");
	    		from.action="remove.do";
	    		from.submit();
	    	
	    }
}
</script>
</body>
</html>